#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

int main() {
	int n;
	cin>>n;
	if (n%10==0) cout<<0<<" "<<0<<" "<<0<<endl;
	else if (n%5==0) cout<<1<<" "<<1<<" "<<2<<endl;
	else cout<<1<<" "<<2<<" "<<3<<endl;
	return 0;
}
